\(\int x^2 (a+b \arctan (c x)) \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 45 \[ \int x^2 (a+b \arctan (c x)) \, dx=-\frac {b x^2}{6 c}+\frac {1}{3} x^3 (a+b \arctan (c x))+\frac {b \log \left (1+c^2 x^2\right )}{6 c^3} \]

[Out]

-1/6*b*x^2/c+1/3*x^3*(a+b*arctan(c*x))+1/6*b*ln(c^2*x^2+1)/c^3

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4946, 272, 45} \[ \int x^2 (a+b \arctan (c x)) \, dx=\frac {1}{3} x^3 (a+b \arctan (c x))+\frac {b \log \left (c^2 x^2+1\right )}{6 c^3}-\frac {b x^2}{6 c} \]

[In]

Int[x^2*(a + b*ArcTan[c*x]),x]

[Out]

-1/6*(b*x^2)/c + (x^3*(a + b*ArcTan[c*x]))/3 + (b*Log[1 + c^2*x^2])/(6*c^3)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4946

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTan[c*x^
n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))),
x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{3} x^3 (a+b \arctan (c x))-\frac {1}{3} (b c) \int \frac {x^3}{1+c^2 x^2} \, dx \\ & = \frac {1}{3} x^3 (a+b \arctan (c x))-\frac {1}{6} (b c) \text {Subst}\left (\int \frac {x}{1+c^2 x} \, dx,x,x^2\right ) \\ & = \frac {1}{3} x^3 (a+b \arctan (c x))-\frac {1}{6} (b c) \text {Subst}\left (\int \left (\frac {1}{c^2}-\frac {1}{c^2 \left (1+c^2 x\right )}\right ) \, dx,x,x^2\right ) \\ & = -\frac {b x^2}{6 c}+\frac {1}{3} x^3 (a+b \arctan (c x))+\frac {b \log \left (1+c^2 x^2\right )}{6 c^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.11 \[ \int x^2 (a+b \arctan (c x)) \, dx=-\frac {b x^2}{6 c}+\frac {a x^3}{3}+\frac {1}{3} b x^3 \arctan (c x)+\frac {b \log \left (1+c^2 x^2\right )}{6 c^3} \]

[In]

Integrate[x^2*(a + b*ArcTan[c*x]),x]

[Out]

-1/6*(b*x^2)/c + (a*x^3)/3 + (b*x^3*ArcTan[c*x])/3 + (b*Log[1 + c^2*x^2])/(6*c^3)

Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.02

method result size
parts \(\frac {x^{3} a}{3}+\frac {b \left (\frac {c^{3} x^{3} \arctan \left (c x \right )}{3}-\frac {c^{2} x^{2}}{6}+\frac {\ln \left (c^{2} x^{2}+1\right )}{6}\right )}{c^{3}}\) \(46\)
derivativedivides \(\frac {\frac {a \,c^{3} x^{3}}{3}+b \left (\frac {c^{3} x^{3} \arctan \left (c x \right )}{3}-\frac {c^{2} x^{2}}{6}+\frac {\ln \left (c^{2} x^{2}+1\right )}{6}\right )}{c^{3}}\) \(50\)
default \(\frac {\frac {a \,c^{3} x^{3}}{3}+b \left (\frac {c^{3} x^{3} \arctan \left (c x \right )}{3}-\frac {c^{2} x^{2}}{6}+\frac {\ln \left (c^{2} x^{2}+1\right )}{6}\right )}{c^{3}}\) \(50\)
parallelrisch \(\frac {2 x^{3} \arctan \left (c x \right ) b \,c^{3}+2 a \,c^{3} x^{3}-b \,c^{2} x^{2}+b \ln \left (c^{2} x^{2}+1\right )}{6 c^{3}}\) \(50\)
risch \(-\frac {i x^{3} b \ln \left (i c x +1\right )}{6}+\frac {i x^{3} b \ln \left (-i c x +1\right )}{6}+\frac {x^{3} a}{3}-\frac {b \,x^{2}}{6 c}+\frac {b \ln \left (-c^{2} x^{2}-1\right )}{6 c^{3}}\) \(64\)

[In]

int(x^2*(a+b*arctan(c*x)),x,method=_RETURNVERBOSE)

[Out]

1/3*x^3*a+b/c^3*(1/3*c^3*x^3*arctan(c*x)-1/6*c^2*x^2+1/6*ln(c^2*x^2+1))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.09 \[ \int x^2 (a+b \arctan (c x)) \, dx=\frac {2 \, b c^{3} x^{3} \arctan \left (c x\right ) + 2 \, a c^{3} x^{3} - b c^{2} x^{2} + b \log \left (c^{2} x^{2} + 1\right )}{6 \, c^{3}} \]

[In]

integrate(x^2*(a+b*arctan(c*x)),x, algorithm="fricas")

[Out]

1/6*(2*b*c^3*x^3*arctan(c*x) + 2*a*c^3*x^3 - b*c^2*x^2 + b*log(c^2*x^2 + 1))/c^3

Sympy [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.09 \[ \int x^2 (a+b \arctan (c x)) \, dx=\begin {cases} \frac {a x^{3}}{3} + \frac {b x^{3} \operatorname {atan}{\left (c x \right )}}{3} - \frac {b x^{2}}{6 c} + \frac {b \log {\left (x^{2} + \frac {1}{c^{2}} \right )}}{6 c^{3}} & \text {for}\: c \neq 0 \\\frac {a x^{3}}{3} & \text {otherwise} \end {cases} \]

[In]

integrate(x**2*(a+b*atan(c*x)),x)

[Out]

Piecewise((a*x**3/3 + b*x**3*atan(c*x)/3 - b*x**2/(6*c) + b*log(x**2 + c**(-2))/(6*c**3), Ne(c, 0)), (a*x**3/3
, True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.02 \[ \int x^2 (a+b \arctan (c x)) \, dx=\frac {1}{3} \, a x^{3} + \frac {1}{6} \, {\left (2 \, x^{3} \arctan \left (c x\right ) - c {\left (\frac {x^{2}}{c^{2}} - \frac {\log \left (c^{2} x^{2} + 1\right )}{c^{4}}\right )}\right )} b \]

[In]

integrate(x^2*(a+b*arctan(c*x)),x, algorithm="maxima")

[Out]

1/3*a*x^3 + 1/6*(2*x^3*arctan(c*x) - c*(x^2/c^2 - log(c^2*x^2 + 1)/c^4))*b

Giac [F]

\[ \int x^2 (a+b \arctan (c x)) \, dx=\int { {\left (b \arctan \left (c x\right ) + a\right )} x^{2} \,d x } \]

[In]

integrate(x^2*(a+b*arctan(c*x)),x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.40 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.93 \[ \int x^2 (a+b \arctan (c x)) \, dx=\frac {a\,x^3}{3}+\frac {b\,x^3\,\mathrm {atan}\left (c\,x\right )}{3}+\frac {b\,\ln \left (c^2\,x^2+1\right )}{6\,c^3}-\frac {b\,x^2}{6\,c} \]

[In]

int(x^2*(a + b*atan(c*x)),x)

[Out]

(a*x^3)/3 + (b*x^3*atan(c*x))/3 + (b*log(c^2*x^2 + 1))/(6*c^3) - (b*x^2)/(6*c)